package org.lex.platinfo;

import java.awt.Desktop;
import java.awt.SystemTray;
import java.io.File;
import java.nio.charset.Charset;
import java.util.Currency;
import java.util.Locale;
import java.util.TimeZone;

public class PlatformInfo {
	public static void main(String[] args) {
		new PlatformInfo().run();
	}

	public void run() {
		Package java = Package.getPackage("java.lang");
		System.out.format("%-26s : %s%n", "Java Specification Title", java.getSpecificationTitle());
		System.out.format("%-26s : %s%n", "Java Specification Version", java.getSpecificationVersion());
		System.out.format("%-26s : %s%n", "Java Implemention Title", java.getImplementationTitle());
		System.out.format("%-26s : %s%n", "Java Implemention Version", java.getImplementationVersion());
		System.out.format("%-26s : %s%n%n", "Java Implemention Vendor", java.getImplementationVendor());

		System.out.format("%-16s : %s%n", "Default Charset", Charset.defaultCharset());
		TimeZone tz = TimeZone.getDefault();
		System.out.format("%-16s : %s - %s%n", "Default TimeZone", tz.getDisplayName(), tz.getID());
		Locale locale = Locale.getDefault();
		System.out.format("%-16s : %s%n", "Default Locale", locale);
		System.out.format("%-16s : %s - %s - %s%n", "Country", locale.getCountry(), locale.getISO3Country(), locale.getDisplayCountry());
		System.out.format("%-16s : %s - %s - %s%n", "Language", locale.getLanguage(), locale.getISO3Language(), locale.getDisplayLanguage());

		Currency cur = Currency.getInstance(locale);
		System.out.format("%-16s : %s - %s%n%n", "Currency", cur.getCurrencyCode(), cur.getSymbol(locale));

		System.out.format("%-20s : %s%n", "Support Desktop", Desktop.isDesktopSupported());
		System.out.format("%-20s : %s%n", "Support System Tray", SystemTray.isSupported());
		System.out.format("%-20s : %s%n", "File Name Separator", File.separator);
		System.out.format("%-20s : %s%n", "File Path Separator", File.pathSeparator);
	}
}
